package gosync

import "sync"

type Counter struct {
	counterType int
	Name string
	mu sync.Mutex
	count uint
}

//赋值 +1
func (c *Counter) Incr() {
	c.mu.Lock()
	defer c.mu.Unlock()
	c.count++
}

//取值
func (c *Counter) Count() uint {
	c.mu.Lock()
	defer c.mu.Unlock()
	return c.count
}